import request from '@/utils/request'
// ---wt(system->sys)
// 查询字典数据列表
export function listData(query) {
  return request({
    url: '/sys/enterpriseDictDataApi/list',
    method: 'post',
    params: query
  })
}

// 查询字典数据详细
export function getData(dictCode) {
  return request({
    url: '/sys/enterpriseDictDataApi/get/' + dictCode,
    method: 'get'
  })
}

// 根据字典类型查询字典数据信息
export function getDicts(dictType) {
  const data = {
    'dictTypes': dictType
  }
  return request({
    url: '/sys/enterpriseDictTypeApi/listByDictType',
    method: 'post',
    params: data
  })
}
// 获取字典数据，一次性请求多条个人字典数据
export function getEnterpriseDate(data) {
  return request({
    url: '/sys/project/customApi/getEnterpriseDate',
    method: 'post',
    data,
    headers: { 'content-type': 'application/json' }
  })
}
// 新增字典数据
export function addData(data) {
  return request({
    url: '/sys/enterpriseDictDataApi/add',
    method: 'post',
    params: data
  })
}

// 修改字典数据
export function updateData(data) {
  return request({
    url: '/sys/enterpriseDictDataApi/update',
    method: 'post',
    params: data
  })
}

// 删除字典数据
export function delData(dictCode) {
  const data = {
    'ids': dictCode
  }
  return request({
    url: '/sys/enterpriseDictDataApi/remove',
    method: 'post',
    params: data
  })
}

// 导出字典数据
export function exportData(query) {
  return request({
    url: '/sys/enterpriseDictDataApi/export',
    method: 'get',
    params: query
  })
}

// 字典排序
export function getMaxDicyData() {
  return request({
    url: '/sys/enterpriseDictTypeApi/getMaxCode',
    method: 'post'
  })
}
